﻿using UnityEngine;
using System.Collections;

public class ExitButton : MonoBehaviour {

    public GameManager game;

    // Use this for initialization
    void Start()
    {
        game = GameObject.FindObjectOfType<GameManager>();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void OnMouseDown()
    {
        AudioSource clickAudio = GetComponent<AudioSource>();
        clickAudio.Play();
        game.ExitGame();
    }
}
